package com.youxiong.Util;

public class ResultData<T> {
    private int code;

    private String message;

    private T data;

    public ResultData success(){
        this.code = 0;
        return this;
    }

    public ResultData success(T data){
        this.code = 0;
        this.data = data;
        return this;
    }

    public ResultData  success(String message, T data){
        this.message = message;
        this.data = data;
        return this;
    }
    public ResultData warn(int code, String message){
        this.code = code;
        this.message = message;
        return this;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
